@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <section class="panel panel-default text-sm doc-buttons">
            <div class="panel-body">
                <a href="{{ route('admin.page.pagelabel_add') }}" class="btn btn-info"><i class="icon-plus ico"></i>
                    &nbsp; 添加模块</a>
            </div>
        </section>
    </div>


    <div class="col-md-12">
        <section class="panel panel-default">
            <header class="panel-heading">
                {{ $frame['title'] }}
            </header>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th class="col-md-3">模块名称</th>
                        <th class="col-md-2">模块标签
                            <small class="text-small">(用于遍历)</small>
                        </th>
                        <th class="col-md-3">作者</th>
                        <th class="col-md-2">编辑时间</th>
                        <th class="col-md-3">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @if( !empty($pageLabels) )
                        @foreach($pageLabels as $label)
                            <tr>
                                <td class="col-md-3">{{ $label->name }}</td>
                                <td class="col-md-2">
                                    {{ '{' }}{ $pages['<span class="text-info">{{ $label->label }}</span>'] }}
                                </td>
                                <td class="col-md-3">{{ $authors[$label->author] }}</td>
                                <td class="col-md-2">{{ $label->updated_at }}</td>
                                <td class="col-md-3">
                                    <a class="btn btn-xs btn-default"
                                       href="{{ route('admin.page.pageinfo_add') }}?label={{ $label->id }}">添加信息</a>
                                    <a href="{{ route('admin.page.pagelabel_edit',$label->id) }}"
                                       class="btn btn-xs btn-default">编辑</a>
                                    <a href="{{ route('admin.page.pagelabel') }}?del={{ $label->id }}"
                                       class="btn btn-xs btn-danger">删除</a>
                                </td>
                            </tr>
                        @endforeach
                    @endif
                    </tbody>
                </table>
            </div>
        </section>
    </div>
@endsection

@section('js')
@endsection